# -*- encoding=utf8 -*-
from selenium import webdriver

class switchToWindow:
    wd = webdriver.Chrome()

    @classmethod
    def switchToWindowByTitle(cls,title):
        handles = cls.wd.window_handles

        for handle in handles:
            cls.wd.switch_to.window(handle)
            if cls.wd.title == title:
                print("切换到：{}".format(title))
                return